{itemplate 'public/header'}
{if $_W['member']['setmeal_id'] > 0}
<div class="page card-center">
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left back" href="javascript:;"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title">会员中心</h1>
	</header>
	<nav class="bar bar-tab footer-bar">
		<div class="pay-btn"><a href="{php echo imurl('deliveryCard/apply/index');}">马上续费</a></div>
	</nav>
	<div class="content">
		<div class="user-info">
			<div class="list-block media-list">
				<ul>
					<li>
						<div class="item-content">
							<div class="item-media"><img src="{php echo tomedia($_W['member']['avatar']);}" style='width: 2.2rem;'></div>
							<div class="item-inner">
								<div class="item-title-row">
									<div class="item-title">
										{$_W['member']['nickname']}
										{if $_W['member']['setmeal_id'] > 0 && $_W['member']['setmeal_endtime'] > TIMESTAMP}
										<img src="{WE7_WMALL_TPL_URL}static/img/vip_effective.png" alt="">
										{else}
										<img src="{WE7_WMALL_TPL_URL}static/img/vip_deprecated.png" alt="">
										{/if}

									</div>
								</div>
								<div class="item-subtitle">平台会员(免拼车费)</div>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
		<div class="card-img">
			<img src="{WE7_WMALL_TPL_URL}static/img/card-setmeal.png" alt="">
			<div class="card-info">
				<p class="use-date">会员期限：<span>{php echo date('Y-m-d', $_W['member']['setmeal_starttime']);}</span>至<span>{php echo date('Y-m-d', $_W['member']['setmeal_endtime']);}</span></p>
				<p class="use-times">每日可免费配送：<span>{$_W['member']['setmeal_day_free_limit']}单</span></p>
			</div>
		</div>
		<div class="card-box">
			<div class="left open-popup border-1px-r" data-popup=".popup-card-privilege">
				<img src="{WE7_WMALL_TPL_URL}static/img/card-mian.png" alt="">
				<p>平台配送免拼车费</p>
			</div>
			<div class="right">
				<img src="{WE7_WMALL_TPL_URL}static/img/card-more.png" alt="">
				<p>敬请期待</p>
			</div>
		</div>
		<p class="card-agreement">
			<a href="javascript:;" class="open-popup" data-popup=".popup-card-agreement">
				<i class="icon icon-question-circle"></i> 会员卡规则
			</a>
		</p>
	</div>
</div>
{else}
<div class="page card-info">
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left back" href="javascript:;"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title">开通会员</h1>
	</header>
	<div class="content">
		<div class="card-img"><img src="{WE7_WMALL_TPL_URL}static/img/card.png" alt=""></div>
		<div class="card-box">
			<div class="left border-1px-r">
				<img src="{WE7_WMALL_TPL_URL}static/img/card-mian.png" alt="">
				<p>平台配送免拼车费</p>
			</div>
			<div class="right">
				<img src="{WE7_WMALL_TPL_URL}static/img/card-more.png" alt="">
				<p>敬请期待</p>
			</div>
		</div>
		<p class="card-agreement">
			<a href="javascript:;" class="open-popup" data-popup=".popup-card-agreement">
				<i class="icon icon-question-circle"></i>会员卡规则
			</a>
		</p>
		<div class="card-button">
			<a href="{php echo imurl('deliveryCard/apply/index');}" class="button button-fill button-round">开通会员</a>
		</div>
	</div>
</div>
{/if}
<div class="popup popup-card-agreement">
	<div class="page card-agreement">
		<header class="bar bar-nav common-bar-nav">
			<a class="pull-left close-popup" href="javascript:;"><i class="icon icon-arrow-left"></i></a>
			<h1 class="title">会员规则详解</h1>
		</header>
		<div class="content" style="background: #FFF">
			<div class="content-padded">
				{$agreement_card}
			</div>
		</div>
	</div>
</div>

<div class="popup popup-card-privilege">
	<div class="page card-privilege">
		<header class="bar bar-nav common-bar-nav">
			<a class="pull-left close-popup" href="javascript:;"><i class="icon icon-arrow-left"></i></a>
			<h1 class="title">免费送餐特权</h1>
		</header>
		<div class="content">
			<div class="tequan-pic"><img src="{WE7_WMALL_TPL_URL}static/img/card-privilege.jpg" alt=""></div>
			<p class="tequan-info">特权说明</p>
			<ul class="tequan-list">
				<li>仅支持平台配送商户使用</li>
				<li>下单拼车费直接扣除</li>
				<li>每日仅限{$_W['member']['setmeal_day_free_limit']}单享受特权</li>
				<li>免费送金额不设限制</li>
			</ul>
			<div class="card-button"><a href="{php echo imurl('wmall/home/index');}" class="button button-fill button-round">现在去购物</a></div>
		</div>
	</div>
</div>
{itemplate 'public/footer'}